home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Amiga_Mail_Vol2 / Archives / Plain / mj91 / ASL / SimpleFR.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-12  |  2.0 KB  |  80 lines

  1. ;/* simpleFR.c - Execute me to compile me with SASC 5.10
  2. LC -b1 -cfistq -v -y -j73 simpleFR.c
  3. Blink FROM LIB:c.o,simpleFR.o TO simpleFR LIBRARY LIB:LC.lib,LIB:Amiga.lib
  4. quit
  5. */
  6.  
  7. /*(c)  Copyright 1991 Commodore-Amiga, Inc.   All rights reserved.
  8. The information contained herein is subject to change without notice,
  9. and is provided "as is" without warranty of any kind, either expressed
  10. or implied.  The entire risk as to the use of this information is
  11. assumed by the user.
  12. */
  13.  
  14. #include <clib/asl_protos.h>
  15. #include <clib/exec_protos.h>
  16. #include <clib/alib_stdio_protos.h>
  17. #include <dos/dosasl.h>
  18. #include <exec/libraries.h>
  19.  
  20. #ifdef LATTICE
  21. int CXBRK(void) { return(0); }  /* Disable Lattice CTRL/C handling */
  22. int chkabort(void) { return(0); }  /* really */
  23. #endif
  24.  
  25. UBYTE *vers = "\0$VER: simpleFR 1.1";
  26.  
  27. void main(void);
  28.  
  29. #define MYLEFTEDGE 0
  30. #define MYTOPEDGE  0
  31. #define MYWIDTH    320
  32. #define MYHEIGHT   400
  33.  
  34. struct Library *AslBase;
  35.  
  36. struct TagItem frtags[] =
  37. {
  38.     ASL_Hail,       (ULONG)"The RKM file requester",
  39.     ASL_Height,     MYHEIGHT,
  40.     ASL_Width,      MYWIDTH,
  41.     ASL_LeftEdge,   MYLEFTEDGE,
  42.     ASL_TopEdge,    MYTOPEDGE,
  43.     ASL_OKText,     (ULONG)"O KAY",
  44.     ASL_CancelText, (ULONG)"not OK",
  45.     ASL_File,       (ULONG)"asl.library",
  46.     ASL_Dir,        (ULONG)"libs:",
  47.     TAG_DONE
  48. };
  49.  
  50.  
  51.  
  52. void main()
  53. {
  54.  
  55.     struct FileRequester *fr;
  56.  
  57.     if (AslBase = OpenLibrary("asl.library", 36L))
  58.     {
  59.         if (fr = (struct FileRequester *)
  60.             AllocAslRequest(ASL_FileRequest, frtags))
  61.         {
  62.             /* Application body, blah, blah,... */
  63.             
  64.             /* Application need a requester */ 
  65.             if (AslRequest(fr, 0L))
  66.                 printf("file choice = %s%s\n", fr->rf_Dir, fr->rf_File);
  67.             else
  68.                 printf("User Cancelled\n");
  69.  
  70.             /* More application body, blah, blah... */
  71.         }
  72.         
  73.         /* Don't need any more requesters, better 
  74.         ** give the requester structure back. 
  75.         */
  76.         FreeAslRequest(fr);
  77.     }
  78.     CloseLibrary(AslBase);
  79. }
  80.